package com.aerfazhe.order.feign;

import com.aerfazhe.order.config.FeignConfig;
import com.aerfazhe.order.pojo.Order;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

/**
 * @Author：wk
 * @Create：2022/4/10/19:49
 * @Description：Feign远程调用库存服务（stock-service）
 * @Version：1.0
 */
@FeignClient(value = "stock-service",path = "/stock",configuration = FeignConfig.class)
public interface StockClient {

    @GetMapping("/reduct")
    @LoadBalanced
    String reduct();

    @PostMapping("/reductStock")
    @LoadBalanced
    Map<String,Object> reductStock(@RequestBody Order order);

}
